package week4;

public class Car {
    String name, type, date;

    public Car(String cn , String ct, String cd){
        name = cn;
        type = ct;
        date = cd;
    }

    public String getName() {
        return name;
    }

    public String getTime() {
        return date;
    }

    public String getType() {
        return type;
    }

    @Override
    public String toString() {
        return "Name: " + name + "\tType: " + type + "\tDate of production: " + date;
    }

    public boolean isAntique() {
        int year;
        boolean Antique;
        year = Integer.parseInt(date);
        if (2018 - year >= 45){
            Antique = true;
        }
        else{
            Antique = false;
        }
        return Antique;
    }
}
